﻿Imports NUnit.Framework
Imports PhDir.DAL

Namespace UnitTesting.DAL

    <TestFixture()>
    Public Class TestDbConfig

        <Test()>
        Public Sub GetTakoyakiContextConnectionStringShouldReturnNothing()
            Dim actualConnectionString = DbConfig.GetConnectionString("TakoyakiContext")
            Assert.IsNull(actualConnectionString)
        End Sub

        <Test()>
        Public Sub GetMasterContextConnectionStringShouldNOTBeNothing()
            Dim actualConnectionString = DbConfig.GetConnectionString("MasterContext")
            Assert.IsNotNull(actualConnectionString)
        End Sub

        <Test()>
        Public Sub IsMasterContextConnectionStringCorrect()
            Dim actualConnectionString = DbConfig.GetConnectionString("MasterContext")
            Dim expectedConnectionString = "Data Source=localhost;Initial Catalog=master;Integrated Security=true"
            Assert.AreEqual(expectedConnectionString, actualConnectionString)
        End Sub

        <Test()>
        Public Sub IsPhoneContextConnectionStringCorrect()
            Dim actualConnectionString = DbConfig.GetConnectionString("PhoneContext")
            Dim expectedConnectionString = "Data Source=localhost;Initial Catalog=PhoneDb;Integrated Security=true"
            Assert.AreEqual(expectedConnectionString, actualConnectionString)
        End Sub

    End Class

End Namespace
